﻿Public Class HomeController
    Inherits System.Web.Mvc.Controller

    Function Index() As ActionResult

        Return View()
    End Function

    Function IngresoDeDni(ByVal dni As String)

        Dim context As New Sist_ElectoralDataContext()

        Dim persona As Tabla_Persona

        persona = From v In context.Tabla_Personas Where v.DNI = dni
        If (persona.Status_Voto = False) Then
            Return View("Index")
        Else
            Return View("Usted ya voto")
        End If
        Return View("Index")
    End Function

    Function VerCandidato() As ActionResult

        Dim context As New Sist_ElectoralDataContext()

        Dim query = From v In context.Tabla_Postulantes
                    Select v.Nombre_Postulante

        Dim listPostulantes As List(Of String) = query.ToList()

        ViewData("postulantes") = listPostulantes

        Return View(listPostulantes)
    End Function
End Class


